/*
 *	2004 JAN 24 SHP
 *		1. Added license
 *		2. Added comment
 */

using System;

namespace FrameworkQ.ObjectSpace.Data.Schema
{
	/// <summary>
	/// Provides field to property mapping facility. In normal circumstances
	/// the field name is equal to the column name of the obejct. If in any 
	/// circumstances the filed name is not equal to the columns then use this 
	/// attribute. For example class User has a property called name that maps
	/// to username field in database. Then on the name property create use this 
	/// attribute.
	/// <code>
	///		[FieldMap("Name")]
	///		public property UserName
	/// </code>
	/// The code above maps the user name property to database field "Name".
	/// <seealso cref="TableMapAttribute"/>	
	/// </summary>
	public class FieldMapAttribute : System.Attribute
	{
		private string _fieldName="";

		/// <summary>
		/// Constructor for FieldMapAttribute
		/// </summary>
		/// <param name="fieldName">Column name in database</param>
		public FieldMapAttribute(string fieldName)
		{
			_fieldName = fieldName;
		}

		/// <summary>
		/// Returns the field name to map in the database.
		/// </summary>
		public string FieldName
		{
			get
			{
				return _fieldName;
			}
		}
	}
}
